package pl.diagnoser.server.persistance.map;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import pl.diagnoser.client.dto.SymptomDictDTO;

@Entity
@Table(name = "D_SYMPTOM")
public class SymptomDict implements Serializable {

        private static final long serialVersionUID = 2569133686270539403L;
        private String symptomName;
        
        public SymptomDict() {};
        public SymptomDict( String symptomName ) {
                this.symptomName = symptomName;
        }
        public SymptomDict( SymptomDictDTO symptomDict ) {
                this.symptomName = symptomDict.getSymptomName();
        }
        
        @Id
        @Column( name = "SYM_NAME", unique = true, nullable = false, length = 50 )
        public String getSymptomName() {
                return this.symptomName;
        }
        
        public void setSymptomName( String symptomName ) {
                this.symptomName = symptomName;
        }
        
        public String toXMLString() {
                String result = new String();
                result = "<symptomDict>";
                result += "<symptom>" + this.symptomName + "</symptom>";
                result += "</symptomDict>";
                return result;
        }
}